import java.util.ArrayList;

public class DefaultSurvey {
	protected ArrayList <Question> questions ;
	private boolean completed ;

	DefaultSurvey(){
		questions = new ArrayList <Question>();
		//When to get connected with the database?
		// Should it be here? When we populate the questions array?
		// should it be here?
		completed = false ;
	}
	
	public ArrayList <Question> getQuestions() {
		return questions;
	}
	//
	public Question getQuestion(int questionNumber){
		return questions.get(questionNumber) ;
	}

	//
	public void setCompleted(boolean cmp){
		completed = cmp ;
	}

	public boolean getCompleted(){
		return completed ;
	}


	public String toString(){
		String retString = "" ;
		String temp ;
		for( int i = 0 ; i < questions.size() ; i++ ){
			temp = String.format("Question no %d is :", i+1) ;

			retString = retString + temp + questions.get(i).getContent()  + "\n";
		}
		return toString() ;
	}
}
